from highs import Highs
import matplotlib.pyplot as plt

plt.style.use('seaborn-v0_8-talk')
# 指定默认字体
plt.rcParams['font.family'] = 'Kai'  # 或其他支持中文的字体
plt.rcParams['axes.unicode_minus'] = False  # 解决负号'-'显示为方块的问题

sitka = Highs('sitka_weather_2018_full.csv')
dates, highs, lows = sitka.get_tmax_and_tmin()

# print(f'date={dates}, highs={highs}, lows={lows}')

fig, ax = plt.subplots()
ax.plot(dates, highs, c='red', alpha=0.5)
ax.plot(dates, lows, c='blue', alpha=0.5)
ax.fill_between(dates, highs, lows, facecolor='blue', alpha=0.1)

# 设置图标标题
ax.set_title('锡特卡全年气温', fontsize = 24)
ax.set_xlabel('', fontsize = 16)
fig.autofmt_xdate()
ax.set_ylabel('温度(F)')
ax.tick_params(axis='both', which='major', labelsize=16)

plt.show()

